<?php
class Dashboard_Model_Dashboarddecision implements Dashboard_Model_Mainable {
    
    private $action_handler;
    
    public function main(array $variables = null) {
        switch($variables['get']['page']){
            case "zarzadzaj-uzytkownikami":
                return $this->manage_users($variables);
                break;
            case 'zarzadzaj-stronami':
                return $this->manage_pages($variables);
                break;
            default :
                return $this->default_action($variables);
                break;
        }
    }
    
    private function manage_pages(array $variables = null){
        $this->action_handler = new Dashboard_Data_Managepages;
        return $this->action_handler->main($variables);
    }
    
    private function manage_users(array $variables = null){
        $this->action_handler = new Dashboard_Data_Manageusers;
        return $this->action_handler->main($variables);
    }
    
    private function default_action(array $variables = null){
        unset($variables);
        $this->action_handler = new Dashboard_Model_Dashboard;
        return $this->action_handler->main($variables);
    }

}

